#import <Foundation/Foundation.h>

#import "PIObject.h"


enum kPICalAvailabilityType {
    kPICalAvailabilityNotSupported = -1,
    kPICalAvailabilityOutOfOffice = 0,
    kPICalAvailabilityBusy,
    kPICalAvailabilityFree,
    kPICalAvailabilityTentative,
    kPICalAvailabilityUnavailable
};

enum PIEventStatusType {
    PIEventStatusTypeNone = 0,
    PIEventStatusTypeConfirmed,
    PIEventStatusTypeTentative,
    PIEventStatusTypeCancelled
};


@interface PIEvent : PIObject
{
    NSString* location;
    NSString* coordinates;
    BOOL coordinatesSet;

    NSString* sectionTitle;
    NSArray* sectionDetails;
    NSInteger sectionStartInterval;
    NSInteger sectionEndInterval;
    
    NSDate* endDate;
    BOOL allDay;

    BOOL reminderInteract;
    
    BOOL invitation;

    NSDate* rangeStartDate;
    NSDate* rangeEndDate;

    kPICalAvailabilityType availability;
    PIEventStatusType status;
    
    NSString* organiser;
    BOOL hasAttendees;
    NSArray* attendees;

    NSDate* firstAlarm;
    NSDate* nextAlarm;
    
    NSArray* alarms;
}

@property (readonly) NSString* location;
@property (readonly) NSString* coordinates;

@property (retain) NSString* sectionTitle;
@property (retain) NSArray* sectionDetails;
@property (assign) NSInteger sectionStartInterval;
@property (assign) NSInteger sectionEndInterval;

@property (retain) NSDate* endDate;
@property (assign, getter=isAllDay) BOOL allDay;
@property (assign, getter=isInvitation) BOOL invitation;

@property (retain) NSDate* rangeStartDate;
@property (retain) NSDate* rangeEndDate;

@property (readwrite, assign) kPICalAvailabilityType availability;
@property (readwrite, assign) PIEventStatusType status;

@property (retain) NSDate* firstAlarm;
@property (retain) NSDate* nextAlarm;
@property (retain) NSArray* alarms;

@property (readwrite, assign) BOOL hasAttendees;
@property (retain) NSArray* attendees;
@property (retain) NSString* organiser;

@property (assign, getter=isReminderInteract) BOOL reminderInteract;


+ (PIEvent*)nativeEventWithKey:(NSString*)key title:(NSString*)title icon:(NSString*)icon location:(NSString*)location startDate:(NSDate*)start endDate:(NSDate*)end allDay:(BOOL)newAllDay calendar:(NSString*)calendar calendarIcon:(NSString*)calIcon calendarColor:(UIColor*)calColor;

+ (PIEvent*)piEventWithKey:(NSString*)key title:(NSString*)title icon:(NSString*)icon location:(NSString*)location startDate:(NSDate*)start endDate:(NSDate*)end allDay:(BOOL)newAllDay calendar:(NSString*)calendar calendarIcon:(NSString*)calIcon calendarColor:(UIColor*)calColor;

- (id)copyInstance:(NSInteger)instance;
- (id)copyWithZone:(NSZone *)zone;
- (id)copyWithZone:(NSZone *)zone instance:(NSInteger)instance;

- (BOOL)hasDetails;

- (NSString*)shortDescription;

@end
